package com.guigu.wenzhiyi.service.impl;

import com.guigu.wenzhiyi.mapper.BodytestMapper;
import com.guigu.wenzhiyi.pojo.Bodytest;
import com.guigu.wenzhiyi.service.BodytestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BodytestServiceImpl implements BodytestService {

    @Autowired
    BodytestMapper bodytestMapper;

    @Override
    public int insert(List<Bodytest> list) {
        int num=0;
        for (Bodytest bodytest : list) {
            num +=bodytestMapper.insert(bodytest);
        }
        return num;
    }

    @Override
    public int updates(List<Bodytest> list) {
        int num =0;
        for (Bodytest bodytest : list) {
            num+=bodytestMapper.updateByPrimaryKeySelective(bodytest);
        }
        return num;
    }

    @Override
    public int delete(Integer id) {
        return bodytestMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<Bodytest> list(Bodytest bodytest) {
        return bodytestMapper.list(bodytest);
    }
}
